package com.by.admin.controller;

import com.by.admin.service.LoginService;
import com.by.apis.admin.LoginControllerApi;
import com.by.model.admin.dtos.UserLoginDto;
import com.by.model.admin.dtos.ZcDto;
import com.by.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController implements LoginControllerApi {
    @Autowired
    private LoginService loginService;

    @Override
    @PostMapping("/in")
    public ResponseResult login(UserLoginDto dto) {
        return loginService.login(dto);
    }

    @Override
    @PostMapping("/zhuce")
    public ResponseResult zhuce(@RequestBody ZcDto dto) {
        return loginService.zhuce(dto);
    }
}
